<html>
<body>
<h1>Contents of: <?js= script.path.path ?></h1>
<hr>
<pre>
<?js
var fullScriptPath = script.mapPath(script.path.path);
var fullPathLength = fullScriptPath.path.length;
var dirEntries = fullScriptPath.directoryEntries;
if (script.path != '/') {
	?>
[DIR] <a href="../">..</a>
<?js
}
if (dirEntries.hasMoreElements()) {
	while (dirEntries.hasMoreElements()) {
		var dirEntry = dirEntries.getNext().QueryInterface(Components.interfaces.nsIFile);
		var dirEntryRelative = dirEntry.path.slice(fullPathLength + 1);
		?>
[<?js= (dirEntry.isDirectory() ? "DIR" : "FILE" ) ?>] <a href="./<?js= dirEntryRelative + (dirEntry.isDirectory() ? '/' : ''); ?>"><?js= dirEntryRelative ?></a>
<?js
	}
}
?>
</pre>
</body>
</html>